package com.dkm.ec.product.repository.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.product.domain.ProdRecType;
import com.dkm.ec.product.persistence.dao.ProdRecTypeQueryDao;
import com.dkm.ec.product.persistence.entity.ProdRecTypePo;
import com.dkm.ec.product.repository.ProdRecTypeRepository;

/**
 * 对象功能:关联推荐类型 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:yuki
 * 创建时间:2015-02-28 18:33:32
 */
@Repository
public class ProdRecTypeRepositoryImpl extends AbstractRepository<String, ProdRecTypePo,ProdRecType> implements ProdRecTypeRepository{
	  
	@Resource
	private  ProdRecTypeQueryDao prodRecTypeQueryDao;

	public ProdRecType newInstance() {
		ProdRecTypePo po = new ProdRecTypePo();
		ProdRecType prodRecType = SpringHelper.getBean(ProdRecType.class);
		prodRecType.setData(po);
		return prodRecType;
	}

	public ProdRecType newInstance(ProdRecTypePo po) {
		ProdRecType prodRecType = SpringHelper.getBean(ProdRecType.class);
		prodRecType.setData(po);
		return prodRecType;
	} 
	
	@Override
	protected IQueryDao<String, ProdRecTypePo> getQueryDao() {
		return prodRecTypeQueryDao;
	}

	@Override
	public ProdRecTypePo findByKey(String key) {
		// TODO Auto-generated method stub
		return prodRecTypeQueryDao.findByKey(key);
	}
	
}
